Skip to content

Conversation

@benwest
Copy link
Contributor

@benwest benwest commented Feb 20, 2019

Accept whitespace in var( --var ) expressions

Fix #27

// matches `name[, fallback]`, captures "name" and "fallback"
// See: http://dev.w3.org/csswg/css-variables/#funcdef-var
var RE_VAR_FUNC = (/var\((--[^,\s]+?)(?:\s*,\s*(.+))?\)/);
var RE_VAR_FUNC = (/var\(\s*(--[^,\s]+?)(?:\s*,\s*(.+))?\s*\)/);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benwest Let's add some tests

@MadLittleMods
Copy link
Owner

Thanks @benwest, looks good! We just need some tests to ensure this continues working in the future

Copy link
Contributor Author

@benwest benwest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How's this?

@MadLittleMods MadLittleMods merged commit 500f2fa into MadLittleMods:master Feb 21, 2019
MadLittleMods added a commit that referenced this pull request Feb 21, 2019
@MadLittleMods
Copy link
Owner

Thanks for the contribution @benwest! This is shipped in postcss-css-variables@0.12.0 and published to npm 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants